if both caster and target are on the same side: auto-hit and skip the rest

damage = 120~180 (depending on status effect)

if attacker is a player:
	damage +2x attacker's MAG

if attacker is a monster:
	damage +0.5x attacker's MAG

if target is defending:
	damage x0.75

if target is a player and used brave last turn:
	damage x1.25

if attacker has rod boost for the status element:
	damage +25

if target is weak to the status element:
	damage x1.5

if target resists the status element:
	damage -70 (-120 if heavy)
	if the target is also a boss:
		damage x0.5

apply field effect for the status element:
	damage -35 (5 opposing dots) to +35 (5 supporting dots)

damage -2x target's VIT

damage = damage x (256 - target's m.evade) / 256

if target has heavy status:
	damage x0.75

if target resists the status specifically:
	damage x0.375 (or 0.421875 if also weak to the element)

if target is a boss:
	damage x0.75

if attacker is a boss and damage < 50:
	damage = 50

if target has vaccine buff:
	damage x0.75

if target is in bull stance:
	damage x0.75

if target is a monster and is still in status recovery
	damage x0.25

apply difficulty modifier if attacker is a monster:
	multiply by 166 153 140 128 112 96 (diff 1 - 6)
	then divide by 128

damage +25% of previous inflicted status damage

if moon icon present and damage > 50:
	go to RNG step

if damage > 160:
	go to RNG step
else:
	go to failure

RNG step:
	X = random number between 0 and target status health
		target status health:
			200 base
			-15 if attacker has mind up
			+15 if target has mind up
			+35 HP if target is heavy
			+35 HP if target is boss
			cap at 255
	if X < damage:
		go to success
	else:
		go to failure
	[on a generic target, chance for status is half the damage but fails if below 80%/25% with moon]

on failure:
	add status damage to total status damage of target

on success:
	if status is polymorph and target can't be morphed:
		replace status with 25% maxHP damage
	reset status damage of target back to 0
	if the target is a monster:
		add resistance flag to the inflicted status
		set monster to be in status recovery for 50-255 ATB ticks (depending on status)